<?php

declare(strict_types=1);

namespace App\Controller\playlet;
use App\Controller\BaseController;
use App\Model\Applet;
use App\Model\AppletCompany;
use Hyperf\HttpServer\Contract\RequestInterface;
use Hyperf\HttpServer\Contract\ResponseInterface;
use Hyperf\HttpServer\Annotation\AutoController;
use Hyperf\Di\Annotation\Inject;
use App\Model\Company;
use App\Common\Response\SystemCode;
use App\Service\playlet\ComplaintsService;

#[AutoController]
class ComplaintsController  extends BaseController
{

    #[Inject]
    private ComplaintsService $complaintsService;

    /**
     * 客投诉列表
     */
    public function Index(RequestInterface $request)
    {
        $data = $this->complaintsService->search($request->query());
        return $this->response(SystemCode::SYSTEM_SUCCESS, '请求成功', $data);
    }

    /**
     * 投诉列表
     */
    public function getApplet(int $id,int $type)
    {
        $data = $this->complaintsService->getToken($id,$type);
        return $this->response(SystemCode::SYSTEM_SUCCESS, '请求成功', $data);
    }
}